﻿@model IEnumerable<Gfw.Web.Models.Stock.BargainRecordModel>
@using Gfw.Infrastructure.Stock.Enums
@{
    Layout = null;
}
@using  Gfw.Web.Common;
@using C.Mvc
@using MvcContrib.UI.Grid;

@using (Ajax.BeginForm("BargainQueryList", "User", new { Area = "Stock" }, Gfw.Web.Common.ViewHelper.AjaxGet))
{

<table id="mytable">
    <tr>
        <th>
            @Html.DisplayNameFor(model => model.BargainType)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.ActualPrice)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.ActualCount)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.TotalPrice)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.BargainDate)
        </th>
       
    </tr>
    @foreach (var item in Model)
    {
        <tr>
            <td>
                @if (item.BargainType == (int)TradeTypeEnum.Buy)
                {
                    <span style="color: Green">买入</span>
                }
                else if (item.BargainType == (int)TradeTypeEnum.Sell)
                {
                      <span style="color:Red">卖出</span>
                }
                else if (item.BargainType == (int)TradeTypeEnum.Cancel)
                {
                  <span style="color:Blue">撤单</span>
                }
                else
                {
                  <span>错误</span>
                }
               
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.ActualPrice)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.ActualCount)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.TotalPrice)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.BargainDate)
            </td>
        </tr>
    }
</table>
    var rnd = new Random();
    @Ajax.DataGridPager().Totals(ViewBag.TotalSize).PageIndex(ViewBag.PageIndex).PagePropertyName("page").Model(new { rd = rnd.NextDouble() }).AjaxOptions(Gfw.Web.Common.ViewHelper.AjaxGet)
}